from waftools.pebble_test import clar

def build(ctx):
    clar(ctx,
        sources_ant_glob = "src/fw/applib/graphics/gtypes.c "
                           "src/fw/applib/graphics/graphics_private_raw.c "
                           "tests/fakes/fake_gbitmap_png.c "
                           "src/fw/applib/ui/layer.c ",
        test_sources_ant_glob="test_layer.c",
        defines=['CAPABILITY_HAS_TOUCHSCREEN'])

    clar(ctx,
        sources_ant_glob = "src/fw/applib/graphics/graphics_private_raw.c "
                           "src/fw/applib/graphics/gtypes.c "
                           "tests/fakes/fake_gbitmap_png.c "
                           "src/fw/applib/ui/layer.c ",
        test_sources_ant_glob="test_layer_rect.c")

    clar(ctx,
        sources_ant_glob = "src/fw/applib/graphics/gtypes.c "
                           "tests/stubs/stubs_animation.c "
                           "tests/fakes/fake_gbitmap_png.c "
                           "src/fw/applib/ui/animation_interpolate.c "
                           "src/fw/applib/ui/layer.c "
                           "src/fw/applib/ui/shadows.c "
                           "src/fw/applib/ui/scroll_layer.c ",
        test_sources_ant_glob="test_scroll_layer.c")

    clar(ctx,
        sources_ant_glob = \
            " src/fw/applib/graphics/8_bit/framebuffer.c"
            " src/fw/applib/graphics/framebuffer.c"
            " src/fw/applib/graphics/bitblt.c"
            " src/fw/applib/graphics/8_bit/bitblt_private.c"
            " src/fw/applib/graphics/gbitmap.c"
            " src/fw/applib/graphics/gcolor_definitions.c"
            " src/fw/applib/graphics/gtypes.c"
            " src/fw/applib/graphics/graphics.c"
            " src/fw/applib/graphics/graphics_private.c"
            " src/fw/applib/graphics/graphics_private_raw.c"
            " src/fw/applib/graphics/graphics_circle.c"
            " src/fw/applib/graphics/graphics_line.c"
            " src/fw/applib/graphics/text_layout.c"
            " src/fw/applib/graphics/utf8.c"
            " src/fw/applib/graphics/text_render.c"
            " src/fw/applib/graphics/text_resources.c"
            " src/fw/applib/fonts/codepoint.c"
            " tests/fakes/fake_clock.c"
            " tests/fakes/fake_fonts.c"
            " tests/fakes/fake_gbitmap_png.c"
            " src/fw/applib/ui/layer.c"
            " src/fw/applib/ui/status_bar_layer.c",
        test_sources_ant_glob="test_status_bar_layer.c",
        defines=['FONT_KEY_GOTHIC_14="RESOURCE_ID_GOTHIC_14"'])

    clar(ctx,
        sources_ant_glob = "src/fw/applib/ui/animation.c "
            "src/fw/applib/ui/animation_interpolate.c "
            "src/fw/applib/ui/animation_timing.c "
            "src/fw/applib/ui/property_animation.c "
            "src/fw/applib/legacy2/ui/animation_legacy2.c "
            "src/fw/applib/legacy2/ui/property_animation_legacy2.c "
            "src/fw/applib/graphics/gtypes.c "
            "src/fw/applib/graphics/gcolor_definitions.c "
            "src/fw/applib/ui/layer.c "
            "tests/fakes/fake_events.c "
            "tests/fakes/fake_rtc.c "
            "tests/fakes/fake_gbitmap_png.c "
            "src/fw/services/common/animation_service.c",
        defines=['DUMA_DISABLED'],  # PBL-18358 Invalid memory read access
        test_sources_ant_glob = "test_animation.c")

    clar(ctx,
        sources_ant_glob = "src/fw/applib/ui/animation_interpolate.c ",
        test_sources_ant_glob = "test_animation_interpolate.c")

    clar(ctx,
        sources_ant_glob = "src/fw/applib/ui/animation_timing.c",
        test_sources_ant_glob = "test_animation_timing.c")

    clar(ctx,
        sources_ant_glob = "src/fw/applib/graphics/gtypes.c"
            " src/fw/applib/ui/layer.c"
            " src/fw/applib/ui/kino/kino_reel.c"
            " src/fw/applib/ui/kino/kino_reel_pdci.c"
            " src/fw/applib/ui/kino/kino_reel_pdcs.c"
            " src/fw/applib/ui/kino/kino_reel_gbitmap.c"
            " src/fw/applib/ui/kino/kino_reel_gbitmap_sequence.c"
            " src/fw/applib/ui/kino/kino_reel_custom.c"
            " src/fw/applib/graphics/gbitmap.c"
            " src/fw/applib/graphics/gbitmap_sequence.c"
            " src/fw/applib/graphics/gbitmap_png.c"
            " src/fw/applib/vendor/uPNG/upng.c"
            " src/fw/applib/vendor/tinflate/tinflate.c"
            " src/fw/applib/graphics/gcolor_definitions.c"
            " src/fw/applib/graphics/gdraw_command.c"
            " src/fw/applib/graphics/gdraw_command_list.c"
            " src/fw/applib/graphics/gdraw_command_image.c"
            " src/fw/applib/graphics/gdraw_command_frame.c"
            " src/fw/applib/graphics/gdraw_command_sequence.c"
            " tests/fakes/fake_resource_syscalls.c"
            " tests/fakes/fake_applib_resource.c"
            " tests/fakes/fake_rtc.c",
        defines = ctx.env.test_image_defines,
        test_sources_ant_glob = "test_kino_reel.c")

    clar(ctx,
        sources_ant_glob = "src/fw/applib/graphics/gtypes.c"
            " src/fw/applib/graphics/gbitmap.c"
            " src/fw/applib/ui/layer.c"
            " src/fw/applib/ui/animation_interpolate.c"
            " src/fw/applib/ui/kino/kino_player.c"
            " src/fw/applib/ui/kino/kino_reel.c"
            " src/fw/applib/ui/kino/kino_reel_pdci.c"
            " src/fw/applib/ui/kino/kino_reel_pdcs.c"
            " src/fw/applib/ui/kino/kino_reel_gbitmap.c"
            " src/fw/applib/ui/kino/kino_reel_gbitmap_sequence.c"
            " src/fw/applib/ui/kino/kino_reel_custom.c"
            " src/fw/applib/graphics/gbitmap_sequence.c"
            " src/fw/applib/graphics/gbitmap_png.c"
            " src/fw/applib/vendor/uPNG/upng.c"
            " src/fw/applib/vendor/tinflate/tinflate.c"
            " src/fw/applib/graphics/gcolor_definitions.c"
            " src/fw/applib/graphics/gdraw_command.c"
            " src/fw/applib/graphics/gdraw_command_list.c"
            " src/fw/applib/graphics/gdraw_command_image.c"
            " src/fw/applib/graphics/gdraw_command_frame.c"
            " src/fw/applib/graphics/gdraw_command_sequence.c"
            " tests/stubs/stubs_animation.c"
            " tests/fakes/fake_resource_syscalls.c"
            " tests/fakes/fake_rtc.c",
        defines = ctx.env.test_image_defines,
        test_sources_ant_glob = "test_kino_player.c")

    clar(ctx,
        sources_ant_glob =
            " src/fw/applib/graphics/gcolor_definitions.c"
            " src/fw/applib/graphics/gtypes.c"
            " src/fw/applib/ui/app_window_stack.c"
            " src/fw/applib/ui/layer.c"
            " src/fw/applib/ui/window.c"
            " src/fw/applib/ui/window_manager.c"
            " src/fw/applib/ui/window_stack.c"
            " src/fw/kernel/ui/modals/modal_manager.c"
            " tests/fakes/fake_animation.c"
            " tests/fakes/fake_events.c"
            " tests/stubs/stubs_click.c",
        test_sources_ant_glob = "test_window_stack.c",
        defines=['SCREEN_COLOR_DEPTH_BITS=8'],
        override_includes=['dummy_board'])

    clar(ctx,
        sources_ant_glob = "src/fw/applib/graphics/gtypes.c"
            " src/fw/util/buffer.c"
            " src/fw/applib/ui/layer.c"
            " src/fw/applib/ui/content_indicator.c",
        test_sources_ant_glob = "test_content_indicator.c")

    clar(ctx,
        sources_ant_glob = "  " \
                           " src/fw/applib/ui/layer.c" \
                           " src/fw/applib/ui/scroll_layer.c" \
                           " src/fw/applib/ui/menu_layer.c" \
                           " src/fw/applib/ui/shadows.c" \
                           " src/fw/applib/ui/animation_interpolate.c "
                           " src/fw/applib/ui/animation_timing.c" \
                           " src/fw/applib/graphics/gcolor_definitions.c" \
                           " src/fw/applib/graphics/gtypes.c" \
                           " tests/stubs/stubs_animation.c",
        test_sources_ant_glob = "test_menu_layer.c")

    menu_layer_system_cell_rendering_sources = \
        " src/fw/applib/fonts/codepoint.c" \
        " src/fw/applib/graphics/${BITDEPTH}_bit/framebuffer.c" \
        " src/fw/applib/graphics/${BITDEPTH}_bit/bitblt_private.c" \
        " src/fw/applib/graphics/bitblt.c" \
        " src/fw/applib/graphics/framebuffer.c" \
        " src/fw/applib/graphics/gbitmap.c" \
        " src/fw/applib/graphics/gbitmap_png.c" \
        " src/fw/applib/graphics/gbitmap_sequence.c" \
        " src/fw/applib/graphics/gcolor_definitions.c" \
        " src/fw/applib/graphics/gdraw_command.c" \
        " src/fw/applib/graphics/gdraw_command_frame.c" \
        " src/fw/applib/graphics/gdraw_command_image.c" \
        " src/fw/applib/graphics/gdraw_command_list.c" \
        " src/fw/applib/graphics/gdraw_command_sequence.c" \
        " src/fw/applib/graphics/gpath.c" \
        " src/fw/applib/graphics/graphics.c" \
        " src/fw/applib/graphics/graphics_bitmap.c" \
        " src/fw/applib/graphics/graphics_circle.c" \
        " src/fw/applib/graphics/graphics_line.c" \
        " src/fw/applib/graphics/graphics_private.c" \
        " src/fw/applib/graphics/graphics_private_raw.c" \
        " src/fw/applib/graphics/gtransform.c" \
        " src/fw/applib/graphics/gtypes.c" \
        " src/fw/applib/graphics/perimeter.c" \
        " src/fw/applib/graphics/text_layout.c" \
        " src/fw/applib/graphics/text_render.c" \
        " src/fw/applib/graphics/text_resources.c" \
        " src/fw/applib/graphics/utf8.c" \
        " src/fw/applib/ui/kino/kino_reel.c" \
        " src/fw/applib/ui/kino/kino_reel_gbitmap.c" \
        " src/fw/applib/ui/kino/kino_reel_gbitmap_sequence.c" \
        " src/fw/applib/ui/kino/kino_reel_pdci.c" \
        " src/fw/applib/ui/kino/kino_reel_pdcs.c" \
        " src/fw/applib/ui/layer.c" \
        " src/fw/applib/ui/menu_layer_system_cells.c" \
        " src/fw/board/displays/display_spalding.c" \
        " src/fw/drivers/flash/flash_crc.c" \
        " src/fw/flash_region/filesystem_regions.c" \
        " src/fw/flash_region/flash_region.c" \
        " src/fw/resource/resource.c" \
        " src/fw/resource/resource_storage.c" \
        " src/fw/resource/resource_storage_builtin.c" \
        " src/fw/resource/resource_storage_file.c" \
        " src/fw/resource/resource_storage_flash.c" \
        " src/fw/services/normal/filesystem/app_file.c" \
        " src/fw/services/normal/filesystem/flash_translation.c" \
        " src/fw/services/normal/filesystem/pfs.c" \
        " src/fw/system/hexdump.c" \
        " src/fw/util/crc8.c" \
        " src/fw/util/legacy_checksum.c" \
        " src/fw/applib/vendor/tinflate/tinflate.c" \
        " src/fw/applib/vendor/uPNG/upng.c" \
        " tests/fakes/fake_applib_resource.c" \
        " tests/fakes/fake_display.c" \
        " tests/fakes/fake_gbitmap_get_data_row.c" \
        " tests/fakes/fake_rtc.c" \
        " tests/fakes/fake_spi_flash.c" \
        " tests/fixtures/resources/builtin_resources.auto.c" \
        " tests/fixtures/resources/pfs_resource_table.c" \
        " tests/stubs/stubs_animation.c" \
        " tests/stubs/stubs_system_theme.c"

    clar(ctx,
         sources_ant_glob = menu_layer_system_cell_rendering_sources + \
                            " src/fw/shell/system_theme.c" \
                            " tests/fakes/fake_fonts.c" \
                            " tests/fixtures/resources/timeline_resource_table.auto.c",
         test_sources_ant_glob = "test_menu_layer_system_cells.c",
         defines=ctx.env.test_image_defines,
         runtime_deps=ctx.env.test_pngs + ctx.env.test_pbis + ctx.env.test_pfos,
         override_includes=['dummy_board'],
         platforms=['snowy', 'spalding', 'silk', 'robert'])

    clar(ctx,
         sources_ant_glob = menu_layer_system_cell_rendering_sources + \
                            " src/fw/applib/ui/action_menu_hierarchy.c" \
                            " src/fw/applib/ui/action_menu_layer.c" \
                            " src/fw/applib/ui/action_menu_window.c" \
                            " src/fw/applib/ui/crumbs_layer.c" \
                            " src/fw/applib/ui/window.c" \
                            " src/fw/applib/ui/menu_layer.c" \
                            " src/fw/applib/ui/scroll_layer.c" \
                            " src/fw/applib/ui/inverter_layer.c" \
                            " src/fw/applib/ui/content_indicator.c" \
                            " tests/fakes/fake_fonts.c" \
                            " src/fw/shell/system_theme.c" \
                            " src/fw/applib/ui/shadows.c",
         test_sources_ant_glob = "test_action_menu_window.c",
         defines=ctx.env.test_image_defines,
         runtime_deps=ctx.env.test_pngs + ctx.env.test_pbis + ctx.env.test_pfos,
         override_includes=['dummy_board'],
         platforms=['tintin', 'snowy', 'spalding', 'robert'])

    clar(ctx,
         sources_ant_glob=(
             menu_layer_system_cell_rendering_sources + " " +
             " src/fw/applib/ui/action_button.c"
             " src/fw/applib/ui/kino/kino_layer.c"
             " src/fw/applib/ui/kino/kino_player.c"
             " src/fw/applib/ui/scroll_layer.c"
             " src/fw/applib/ui/shadows.c"
             " src/fw/applib/ui/status_bar_layer.c"
             " src/fw/applib/ui/window.c"
             " src/fw/apps/system_apps/timeline/text_node.c"
             " src/fw/popups/notifications/notification_window.c"
             " src/fw/popups/notifications/notifications_presented_list.c"
             " src/fw/services/normal/timeline/attribute.c"
             " src/fw/services/normal/timeline/layout_layer.c"
             " src/fw/services/normal/timeline/layout_node.c"
             " src/fw/services/normal/timeline/notification_layout.c"
             " src/fw/services/normal/timeline/swap_layer.c"
             " src/fw/services/normal/timeline/timeline_layout.c"
             " src/fw/services/normal/timeline/timeline_resources.c"
             " src/fw/shell/system_theme.c"
             " tests/fakes/fake_animation.c"
             " tests/fakes/fake_fonts.c"
             " tests/fakes/fake_graphics_context.c"
             " tests/fixtures/resources/timeline_resource_table.auto.c"
             " tests/stubs/stubs_clock.c"
         ),
         test_sources_ant_glob = "test_notification_window.c",
         defines=ctx.env.test_image_defines + ["USE_DISPLAY_PERIMETER_ON_FONT_LAYOUT=1"],
         runtime_deps=ctx.env.test_pngs + ctx.env.test_pbis + ctx.env.test_pfos,
         override_includes=['dummy_board'],
         platforms=['silk', 'snowy', 'spalding', 'robert'])

    clar(ctx,
         sources_ant_glob = menu_layer_system_cell_rendering_sources + \
                            " src/fw/applib/ui/dialogs/simple_dialog.c" \
                            " src/fw/applib/ui/dialogs/dialog.c" \
                            " src/fw/applib/ui/dialogs/dialog_private.c" \
                            " src/fw/applib/ui/animation_interpolate.c" \
                            " src/fw/applib/ui/kino/kino_layer.c" \
                            " src/fw/applib/ui/kino/kino_player.c" \
                            " src/fw/applib/ui/kino/kino_reel_custom.c" \
                            " src/fw/applib/ui/kino/kino_reel/transform.c" \
                            " src/fw/applib/ui/text_layer.c" \
                            " src/fw/applib/ui/text_layer_flow.c" \
                            " src/fw/applib/ui/window.c" \
                            " src/fw/applib/ui/menu_layer.c" \
                            " src/fw/applib/ui/scroll_layer.c" \
                            " src/fw/applib/ui/shadows.c"
                            " src/fw/applib/ui/inverter_layer.c" \
                            " src/fw/applib/ui/content_indicator.c" \
                            " tests/fakes/fake_fonts.c",
         test_sources_ant_glob = "test_simple_dialog.c",
         defines=ctx.env.test_image_defines,
         runtime_deps=ctx.env.test_pngs + ctx.env.test_pbis + ctx.env.test_pfos,
         override_includes=['dummy_board'],
         platforms=['tintin', 'snowy', 'spalding'])

    clar(ctx,
         sources_ant_glob = menu_layer_system_cell_rendering_sources + \
                            " src/fw/applib/fonts/fonts.c",
         test_sources_ant_glob = "test_emoji_fonts.c",
         defines=ctx.env.test_image_defines,
         runtime_deps=ctx.env.test_pngs + ctx.env.test_pbis + ctx.env.test_pfos,
         override_includes=['dummy_board'])

    clar(ctx,
         sources_ant_glob = menu_layer_system_cell_rendering_sources + \
                            " src/fw/applib/ui/action_bar_layer.c" \
                            " src/fw/applib/ui/animation_interpolate.c" \
                            " src/fw/applib/ui/content_indicator.c" \
                            " src/fw/applib/ui/dialogs/dialog.c" \
                            " src/fw/applib/ui/dialogs/dialog_private.c" \
                            " src/fw/applib/ui/dialogs/expandable_dialog.c" \
                            " src/fw/applib/ui/inverter_layer.c" \
                            " src/fw/applib/ui/kino/kino_layer.c" \
                            " src/fw/applib/ui/kino/kino_player.c" \
                            " src/fw/applib/ui/kino/kino_reel/transform.c" \
                            " src/fw/applib/ui/kino/kino_reel_custom.c" \
                            " src/fw/applib/ui/menu_layer.c" \
                            " src/fw/applib/ui/scroll_layer.c" \
                            " src/fw/applib/ui/shadows.c" \
                            " src/fw/applib/ui/text_layer.c" \
                            " src/fw/applib/ui/text_layer_flow.c" \
                            " src/fw/applib/ui/window.c" \
                            " tests/fakes/fake_fonts.c",
         test_sources_ant_glob = "test_expandable_dialog.c",
         defines=ctx.env.test_image_defines + ["USE_DISPLAY_PERIMETER_ON_FONT_LAYOUT=1"],
         runtime_deps=ctx.env.test_pngs + ctx.env.test_pbis + ctx.env.test_pfos,
         override_includes=["dummy_board"],
         platforms=["spalding"])

    clar(ctx,
        sources_ant_glob = "  " \
                           " src/fw/applib/ui/layer.c" \
                           " src/fw/applib/ui/text_layer.c" \
                           " src/fw/applib/graphics/gcolor_definitions.c" \
                           " src/fw/applib/graphics/gtypes.c", \
        test_sources_ant_glob = "test_text_layer.c")

    clar(ctx,
        sources_ant_glob=(
            menu_layer_system_cell_rendering_sources +
            " src/fw/applib/ui/date_time_selection_window_private.c"
            " src/fw/applib/ui/selection_layer.c"
            " src/fw/applib/ui/text_layer.c"
            " src/fw/applib/ui/time_range_selection_window.c"
            " src/fw/applib/ui/time_selection_window.c"
            " src/fw/applib/ui/window.c"
            " src/fw/shell/system_theme.c"
            " src/fw/util/date.c"
            " tests/fakes/fake_clock.c"
            " tests/fakes/fake_fonts.c"
        ),
        test_sources_ant_glob="test_selection_windows.c",
        defines=ctx.env.test_image_defines,
        runtime_deps=ctx.env.test_pngs + ctx.env.test_pbis + ctx.env.test_pfos,
        override_includes=['dummy_board'],
        platforms=['tintin', 'snowy', 'spalding', 'robert'])

    clar(ctx,
        sources_ant_glob = "  " \
                           " src/fw/applib/ui/layer.c" \
                           " src/fw/applib/ui/text_layer.c" \
                           " src/fw/applib/ui/text_layer_flow.c" \
                           " src/fw/applib/graphics/gcolor_definitions.c" \
                           " src/fw/applib/graphics/gtypes.c", \
        test_sources_ant_glob = "test_text_layer_flow.c")

    clar(ctx,
         sources_ant_glob = " src/fw/applib/fonts/codepoint.c" \
                            " src/fw/applib/graphics/utf8.c" \
                            " src/fw/services/normal/timeline/notification_layout.c",
         test_sources_ant_glob = "test_jumboji.c")

    clar(ctx,
         sources_ant_glob=(
             menu_layer_system_cell_rendering_sources + " " +
             "src/fw/applib/ui/animation_interpolate.c "
             "src/fw/applib/ui/kino/kino_layer.c "
             "src/fw/applib/ui/kino/kino_player.c "
             "src/fw/applib/ui/text_layer.c "
             "src/fw/applib/ui/text_layer_flow.c "
             "src/fw/applib/ui/window.c "
             "src/fw/apps/system_apps/timeline/text_node.c "
             "src/fw/popups/timeline/peek.c "
             "src/fw/services/normal/timeline/attribute.c "
             "src/fw/services/normal/timeline/attribute_group.c "
             "src/fw/services/normal/timeline/attributes_actions.c "
             "src/fw/services/normal/timeline/generic_layout.c "
             "src/fw/services/normal/timeline/item.c "
             "src/fw/services/normal/timeline/layout_layer.c "
             "src/fw/services/normal/timeline/layout_node.c "
             "src/fw/services/normal/timeline/timeline_layout.c "
             "src/fw/services/normal/timeline/timeline_resources.c "
             "src/fw/shell/system_theme.c "
             "src/fw/util/stringlist.c "
             "src/fw/util/time/time.c "
             "tests/fakes/fake_clock.c "
             "tests/fakes/fake_fonts.c "
             "tests/fixtures/resources/timeline_resource_table.auto.c "
             "tests/stubs/stubs_app_manager.c "
             "tests/stubs/stubs_clock.c "
             "tests/stubs/stubs_timeline_layout.c "
             "tests/stubs/stubs_timeline_peek.c "
         ),
         test_sources_ant_glob="test_timeline_peek.c",
         defines=ctx.env.test_image_defines + ["CAPABILITY_HAS_TIMELINE_PEEK=1",
                                               "USE_DISPLAY_PERIMETER_ON_FONT_LAYOUT=1"],
         runtime_deps=ctx.env.test_pngs + ctx.env.test_pbis + ctx.env.test_pfos,
         override_includes=['dummy_board'],
         platforms=['snowy', 'spalding', 'silk', 'robert'])

    clar(ctx,
         sources_ant_glob=(
            menu_layer_system_cell_rendering_sources + " " +
            "src/fw/applib/ui/animation_interpolate.c "
            "src/fw/applib/ui/content_indicator.c "
            "src/fw/applib/ui/inverter_layer.c "
            "src/fw/applib/ui/menu_layer.c "
            "src/fw/applib/ui/option_menu_window.c "
            "src/fw/applib/ui/scroll_layer.c "
            "src/fw/applib/ui/shadows.c "
            "src/fw/applib/ui/status_bar_layer.c "
            "src/fw/applib/ui/window.c "
            "src/fw/shell/system_theme.c "
            "tests/fakes/fake_clock.c "
            "tests/fakes/fake_fonts.c "
            "tests/fakes/fake_graphics_context.c "
         ),
         test_sources_ant_glob="test_option_menu_window.c",
         defines=ctx.env.test_image_defines + ["USE_DISPLAY_PERIMETER_ON_FONT_LAYOUT=1"],
         runtime_deps=ctx.env.test_pngs + ctx.env.test_pbis + ctx.env.test_pfos,
         override_includes=['dummy_board'],
         platforms=['snowy', 'spalding', 'silk', 'robert'])

# vim:filetype=vim
